cmake_minimum_required(VERSION 3.5)
project(utils_common)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
find_package(Boost REQUIRED COMPONENTS system filesystem)
file(GLOB SRC_UTILS_COMMON
  "${PROJECT_SOURCE_DIR}/*.cc"
  "${PROJECT_SOURCE_DIR}/geometry/*.cc"
  "${PROJECT_SOURCE_DIR}/graph/*.cc"
  "${PROJECT_SOURCE_DIR}/sensor_manager/*.cc"
  "${PROJECT_SOURCE_DIR}/io/*.cc"
)

add_library(${FUSION_LIB_NAME_PREFIX}_${PROJECT_NAME} SHARED ${SRC_UTILS_COMMON})

target_include_directories(${FUSION_LIB_NAME_PREFIX}_${PROJECT_NAME} 
  PUBLIC
  ${FUSION_INCLUDE_DIRS}
  ${Boost_INCLUDE_DIRS}
  )

target_link_libraries(${FUSION_LIB_NAME_PREFIX}_${PROJECT_NAME}  
  PUBLIC
  glog
  gflags
  ${Boost_LIBRARIES}
  ${FUSION_LINKER_LIBS}
)

list(APPEND FUSION_LINKER_LIBS ${FUSION_LIB_NAME_PREFIX}_${PROJECT_NAME})
set(FUSION_LINKER_LIBS ${FUSION_LINKER_LIBS} PARENT_SCOPE)
